package com.xuebusi.service;

import com.xuebusi.entity.User;
import com.xuebusi.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by SYJ on 2017/11/11.
 */
@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    public User getUserById(Integer id) {
        return userMapper.selectById(id);
    }

    public List<User> findAll() {
        return userMapper.findAll();
    }

    public int insert(User user){
        return userMapper.insert(user);
    }

    public int update(User user) {
        return userMapper.update(user);
    }

    public int deleteById(Integer id) {
        return userMapper.deleteById(id);
    }
}
